package com.qyhl.module_home.utils;


import com.qyhl.webtv.commonlib.entity.home.BestoneItemTypeBean;

import java.util.Comparator;

public class PinyinComparator implements Comparator<BestoneItemTypeBean> {
    @Override
    public int compare(BestoneItemTypeBean bean1, BestoneItemTypeBean bean2) {
        if (bean1.getFirstPinYin() == '#' && bean2.getFirstPinYin() == '#') {
            return bean1.getAllPinYin().compareTo(bean2.getAllPinYin());
        } else if (bean1.getFirstPinYin() == '#') {
            return 1;
        } else if (bean2.getFirstPinYin() == '#') {
            return -1;
        } else {
            return bean1.getAllPinYin().compareTo(bean2.getAllPinYin());
        }
    }
}
